{
//printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
//printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n",
-//prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff);
-//if (prev->domain->id == 1 && next->domain->id == 0) cs10foo();
-//if (prev->domain->id == 0 && next->domain->id == 1) cs01foo();
-//printk("@@sw %d->%d\n",prev->domain->id,next->domain->id);
+//prev->domain->domain_id,(long)prev&0xffffff,next->domain->domain_id,(long)next&0xffffff);
+//if (prev->domain->domain_id == 1 && next->domain->domain_id == 0) cs10foo();
+//if (prev->domain->domain_id == 0 && next->domain->domain_id == 1) cs01foo();
+//printk("@@sw %d->%d\n",prev->domain->domain_id,next->domain->domain_id);
+ #ifdef CONFIG_VTI
+ unsigned long psr;
+ /* Interrupt is enabled after next task is chosen.
+ * So we have to disable it for stack switch.
+ */
+ local_irq_save(psr);
+ vtm_domain_out(prev);
+ /* Housekeeping for prev domain */
+ #endif // CONFIG_VTI
+
switch_to(prev,next,prev);
+ #ifdef CONFIG_VTI
+ /* Post-setup for new domain */
+ vtm_domain_in(current);
+ local_irq_restore(psr);
+ #endif // CONFIG_VTI
// leave this debug for now: it acts as a heartbeat when more than
// one domain is active
{
if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; }
if (!i--) { printk("+",id); cnt[id] = 100; }
}
- clear_bit(EDF_RUNNING, &prev->flags);
+ clear_bit(_VCPUF_running, &prev->vcpu_flags);
//if (!is_idle_task(next->domain) )
//send_guest_virq(next, VIRQ_TIMER);
+ #ifdef CONFIG_VTI
+ if (VMX_DOMAIN(current))
+ vmx_load_all_rr(current);
+ return;
+ #else // CONFIG_VTI
load_region_regs(current);
if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
+ #endif // CONFIG_VTI
}
void continue_running(struct exec_domain *same)